---
title: "Mariadb Client 与 MySQL Client不同的地方"
date: 2020-6-9
categories:
- mysql
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6d75bf1">–login-path</a></li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-org6d75bf1">
<h2 id="org6d75bf1">–login-path</h2>
<div class="outline-text-2" id="text-org6d75bf1">
<blockquote>
<p>
<a href="https://stackoverflow.com/questions/49109592/where-store-password-login-path-in-mariadb-equivalent-for-mysql-config-editor">https://stackoverflow.com/questions/49109592/where-store-password-login-path-in-mariadb-equivalent-for-mysql-config-editor</a>
</p>
</blockquote>
<p>
mariadb的mysql命令没有–login-path选项。但是–defaults-extra-file也能实现从文件中读取账号密码简化命令。文件内容：
</p>
<pre class="example">
[client]
host='&lt;your-db-host&gt;'
port='&lt;your-db-port&gt;'
socket='&lt;your-db-socket&gt;'
database='&lt;your-db-name&gt;'
user='&lt;your-db-user&gt;'
password='&lt;your-db-password&gt;'
</pre>
<div class="org-src-container">
<pre class="src src-bash">mysql --defaults-extra-file=&lt;file name&gt;
</pre>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2020-6-9</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
